#ifndef UUID_185E1C84898943325A274C99E7D25526
#define UUID_185E1C84898943325A274C99E7D25526

#ifdef __cplusplus
extern "C" {
#endif

enum
{
	flip_ev_button
};

typedef struct flip_event_button_
{
	unsigned id;
	int  state;
} flip_event_button;

typedef struct flip_event_
{
	int type;
	union
	{
		flip_event_button button;
	} data;
} flip_event;

typedef struct flip_window_handlers_
{
	void (*event)(struct flip_window_* w, flip_event const* ev);
	void (*button)(struct flip_window_* w, unsigned id, int state);
} flip_window_handlers;

#define FLIP_EVENT_FUN(name, ev) \
	void name(flip_window* self, flip_event const* ev)

#define FLIP_BUTTON_FUN(name, id, state) \
	void name(flip_window* self, unsigned id, int state)

#define FLIP_EVENTS(window) do { \
	flip_window* _flip_window = (window); \
	flip_window_default_handlers(_flip_window)
	
#define FLIP_ON_EVENT(name) _flip_window->handlers.event = (name)
#define FLIP_ON_BUTTON(name) _flip_window->handlers.button = (name)

#define FLIP_EVENTS_END() } while(0)

#ifdef __cplusplus
} // extern "C"
#endif

#endif // UUID_185E1C84898943325A274C99E7D25526
